package com.newcapec.erp.main;

import com.newcapec.erp.bean.LoginEntity;
import com.newcapec.erp.ui.MainUI;

import javax.swing.*;

public class LoginManager {
    public static LoginEntity currentLoginEntity;
     //账号密码的验证
    public void chkLogin(LoginEntity loginEntity){
        if(loginEntity.getLoginName().equals(DataInit.adminEntity.getAdminAn())&&loginEntity.getPassword().equals(DataInit.adminEntity.getAdminPwd())){
            //登录成功之后进入主页面  然后关闭登录界面  MainUI
            currentLoginEntity = loginEntity;
            MainUI.getMainUI();

        }else {
            JPanel jPanel=new JPanel();
            JOptionPane.showMessageDialog(jPanel, "密码输入错误，请重新输入", "警告",JOptionPane.WARNING_MESSAGE);
        }
    }
}
